#pragma once

#include "File.h"
#include "FormatQualifier.h"
#include "algorithms/HashAlgorithm.h"

#include <string>
#include <vector>
#include <memory>
#include <exception>

#include "types.h"

class FilesystemReader {
public:

    FilesystemReader(const std::string& root_path, 
                     const std::shared_ptr<HashAlgorithm>& hash_alg,
                     const std::shared_ptr<FormatQualifier>& formatQualifier);

    FilesType readFiles() const; 

    class FilesystemError : public std::exception {
    public:

        explicit FilesystemError(const char* msg);
        explicit FilesystemError(const std::string& msg); 

        virtual ~FilesystemError() = default;

        virtual const char* what() const noexcept;

    protected:

        std::string msg_;
    };

private:

    std::string root_path_; 
    std::shared_ptr<HashAlgorithm> hash_alg_;
    std::shared_ptr<FormatQualifier> formatQualifier_;
};
